package com.technology.education.ui.common.role_selector

import android.os.Bundle
import com.technology.education.data.AppData
import com.technology.education.databinding.ActivityRoleSelectorBinding
import com.technology.education.ui.common.login.ActivityLogin
import me.hgj.jetpackmvvm.base.activity.BaseVmDbActivity
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.util.startActivity

/**
 *@author:create by BZY
 *Date: 2022/3/1 08
 * 选择角色
 */
class RoleSelectorActivity : BaseVmDbActivity<BaseViewModel, ActivityRoleSelectorBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.btnMarket.setOnClickListener {
            ///推广人员
            select(2)
        }
        mDatabind.btnStudent.setOnClickListener {
            //学生
            select(0)
        }

        mDatabind.btnTeacher.setOnClickListener {
            //辅导员
            select(1)
        }
        mDatabind.toolBar.toolbar.setNavigationOnClickListener {
            onBackPressed()
        }
    }

    private fun select(type: Int) {
        AppData.MEMBER_TYPE = type.toString()
        this.startActivity(ActivityLogin::class)
        onBackPressed()
    }

    override fun showLoading(message: String) {

    }

    override fun dismissLoading() {
    }

    override fun createObserver() {
    }
}